<mat-card *ngIf="selectedEmail != null">Email #{{selectedEmail.id}} - {{selectedEmail.email}}</mat-card>
<div class="content">
  <button mat-raised-button (click)="send()">Reply</button>
  <mat-progress-spinner *ngIf="selectedEmail == null" mode="indeterminate"></mat-progress-spinner>
  <div *ngIf="selectedEmail != null">
    <mat-card *ngFor="let email of obs | async">
      <mat-list>
        <mat-list-item>
          Type: {{email.emailType}}
        </mat-list-item>
        <mat-divider></mat-divider>
        <mat-list-item>
          Address: {{email.email}}
        </mat-list-item>
        <mat-divider></mat-divider>
        <mat-list-item>
          Date and time: {{email.timestamp | date: 'yyyy-MM-dd, HH:mm'}}
        </mat-list-item>
        <mat-divider></mat-divider>
        <mat-list-item>
          Subject: {{email.subject}}
        </mat-list-item>
        <mat-divider></mat-divider>
      </mat-list>
      <div class="email" [innerHtml]="getContent(email.content)"></div>
    </mat-card>
    <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
  </div>
</div>
